
function init(){
	
	var ubwidget = $("#ubwidget").ubwidget({
		width:252,
		height:89
	});
		
	var space = $("<div style='font-size:15px'>h</div>").ubwbutton({w:17, h:68});
		space.find(".ubw-button-body").css({
			borderLeft:"none",
			borderRight:"none"
		});
	var spaceb = $("<div style='font-size:15px'>m</div>").ubwbutton({w:17, h:68});
		spaceb.find(".ubw-button-body").css({
			borderLeft:"none",
			borderRight:"none"
		});
		spaceb.find(".ubw-button-canvas").unbind("mouseenter");
	var spacec = $("<div style='font-size:15px'>s</div>").ubwbutton({w:17, h:68});
		spacec.find(".ubw-button-body").css({
			borderLeft:"none",
			borderRight:"none"
		});
		spacec.find(".ubw-button-canvas").unbind("mouseenter");
		
			var hours = $("<div class='scroll' id='hours'>00</div>").ubwbutton({w:52, h:68}, {bottom:1, top:1, right:0, left:0});
				hours.find(".ubw-button-body").css({
					borderRight:"none"
				});
			var minutes = $("<div class='scroll' id='minutes'>00</div>").ubwbutton({w:52, h:68}, {bottom:1, top:1, right:0, left:0});
				minutes.find(".ubw-button-body").css({
					borderLeft:"none",
					borderRight:"none"
				});
			var seconds = $("<div class='scroll' id='seconds'>00</div>").ubwbutton({w:52, h:68}, {bottom:1, top:1, right:0, left:0});
				seconds.find(".ubw-button-body").css({
					borderLeft:"none",
					borderRight:"none"
				});
									
			setTimeout(function(){pause.trigger("click")}, 200);
			
			ubwidget
				.append(hours)
				.append(space.clone())
				.append(minutes)
				.append(spaceb)
				.append(seconds)
				.append(spacec)
							
			clearTimeout(currentTimer);
			updateClock();

	var currentTimer = null;
	var incDecTime = null;
	var play = true;
	var isScrolling = false;	
	var reverse = true;
	var activeTimeScroll = null;
	
	function updateClock(){
		
		var currentTime = new Date();

		hoursValue = $("#hours").find(".ubw-button-content");
		minutesValue = $("#minutes").find(".ubw-button-content");
		secondsValue = $("#seconds").find(".ubw-button-content");
		
		currentTimer = setTimeout(function(){updateClock()}, 1000);
		
		hoursValue.text(formatTime(currentTime.getHours()));
		minutesValue.text(formatTime(currentTime.getMinutes()));
		secondsValue.text(formatTime(currentTime.getSeconds()));
		
	}	
	
	function formatTime(time){
		
		document.title = time +", " + String(time).length;
		
		if(time<0){
			time = 59;
		}
		
		time = time%60;
	
		String(time).length < 2 ? time = "0"+time : time = time;
	
		return time;		
	}
}